package com.cardbaobao.cardbabyclient.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;

import com.cardbaobao.cardbabyclient.R;
import com.cardbaobao.cardbabyclient.ui.activity.base.BaseActivity;
import com.cardbaobao.cardbabyclient.widget.TitleBar;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by Jiangzx on 2017/7/4 14:34.
 * 查无数据
 */
public class InquireNoDataActivity extends BaseActivity {
    public static final String TITLE_TEXT="titleText";

    @BindView(R.id.title_bar)
    TitleBar titleBar;

    @Override
    protected void initData(Bundle savedInstanceState) {
        super.initData(savedInstanceState);
        Intent intent=getIntent();
        String title=intent.getStringExtra(TITLE_TEXT);
        final String channelType=intent.getStringExtra(InquiriesActivity.CHANNEL_TYPE_S);
        if(TextUtils.isEmpty(title)){
            titleBar.setTitleText("查询结果");
        }else{
            titleBar.setTitleText(title);
        }
        titleBar.setLeftViewOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        titleBar.setRightBtClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                initIntent();
                mIntent.setClass(mContext,InquiriesActivity.class);
                mIntent.putExtra(InquiriesActivity.CHANNEL_TYPE_S,channelType);
                startActivity(mIntent);
                finish();
            }
        });
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_inquire_no_data;
    }

    @OnClick(R.id.bt_back)
    public void onClick(View view){
        finish();
    }
}
